package com.tiany.tiange_study.ListActivity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.Toast;

import androidx.annotation.Nullable;

import com.tiany.tiange_study.R;

public class ListViewActivity extends Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_listview);
        ListView mListView = findViewById(R.id.list_view1);
        mListView.setAdapter(new MyListAdapter(ListViewActivity.this));
        mListView.setOnItemClickListener((parent, view, position, id) -> Toast.makeText(ListViewActivity.this,"pos:"+position,Toast.LENGTH_SHORT).show());
    }
}
